package com.bootdo.lvyou.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.lvyou.dao.LvyouPunchCardDao;
import com.bootdo.lvyou.domain.LvyouPunchCard;
import com.bootdo.lvyou.service.LvyouPunchCardService;



@Service
public class LvyouPunchCardServiceImpl implements LvyouPunchCardService {
	@Autowired
	private LvyouPunchCardDao lvyouPunchCardDao;
	
	@Override
	public LvyouPunchCard get(Long id){
		return lvyouPunchCardDao.get(id);
	}
	
	@Override
	public List<LvyouPunchCard> list(Map<String, Object> map){
		return lvyouPunchCardDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return lvyouPunchCardDao.count(map);
	}
	
	@Override
	public int save(LvyouPunchCard lvyouPunchCard){
	
		if(lvyouPunchCard.getId() != null) {
			return lvyouPunchCardDao.update(lvyouPunchCard);
		}else {
			return lvyouPunchCardDao.save(lvyouPunchCard);
		}		
	
		
	}
	
	@Override
	public int update(LvyouPunchCard lvyouPunchCard){
		return lvyouPunchCardDao.update(lvyouPunchCard);
	}
	
	@Override
	public int remove(Long id){
		return lvyouPunchCardDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return lvyouPunchCardDao.batchRemove(ids);
	}

	@Override
	public List<LvyouPunchCard> getByParentId(Long id) {
		return lvyouPunchCardDao.getByParentId(id);
	}

	@Override
	public List<LvyouPunchCard> getByParentIidAndMemberId(Long memberId, Long parentId) {
		return lvyouPunchCardDao.getByParentIidAndMemberId(memberId, parentId);
	}

	@Override
	public List<LvyouPunchCard> getByParentIidAndMemberIdAndScenicSopt(Long memberId, Long parentId, Long scenicId) {
		return lvyouPunchCardDao.getByParentIidAndMemberIdAndScenicSopt(memberId, parentId, scenicId);
	}

	@Override
	public List<LvyouPunchCard> getByParentIdLimit(Long id, Integer offset, Integer limit) {
		return lvyouPunchCardDao.getByParentIdLimit(id,offset,limit);
	}

	@Override
	public List<LvyouPunchCard> selectIsReadCardMessage(Long memberId) {
		return lvyouPunchCardDao.selectIsReadCardMessage(memberId);
	}

	@Override
	public List<LvyouPunchCard> selectIsReadCardMessageAll(Long memberId) {
		return lvyouPunchCardDao.selectIsReadCardMessageAll(memberId);
	}

	@Override
	public Integer selectIsReadCardMessageNumber(Long memberId) {
		return lvyouPunchCardDao.selectIsReadCardMessageNumber(memberId);
	}

}
